﻿import React from 'react';
import { Calendar, Icon } from 'antd';
import { isEqual } from 'lodash';
import { formatDate, _str2Int } from '../../util/common';
import { getLunarDatas } from './util.js';
import { WeaErrorPage, WeaTools, WeaNewScroll,WeaLocaleProvider } from 'ecCom';
const getLabel = WeaLocaleProvider.getLabel;
const { ls } = WeaTools;
//日历日程元素
class CalendarTemplate extends React.Component {
    constructor(props) {
        super(props);
        let _date = new Date();
        this.state = {
            weaWorkplanLoaded: false,
            refresh: false,
            data: props.data,
            workplanData: [],
            createVisible: false,
            createType: 'create',
            workPlanId: '',
            currentDate: formatDate(_date, "yyyy-MM-dd"),
            currentMonth: formatDate(_date, "yyyy-MM"),
            activeKey: '1',
            singlePageVisible: false,
            type: 'month',
            selectYear: formatDate(_date, "yyyy"),
            firstDay: formatDate(_date, "yyyy-MM-dd")
        }
        this.doAdd = this.doAdd.bind(this);
        this.onAdd = this.onAdd.bind(this);
        this.onClose = this.onClose.bind(this);
        this.onClickData = this.onClickData.bind(this);
        this.dateCellRender = this.dateCellRender.bind(this);
        this.monthCellRender = this.monthCellRender.bind(this);
        this.clickCalendarMonth = this.clickCalendarMonth.bind(this);
        this.getWorkplanData = this.getWorkplanData.bind(this);
        this.clickCalendarDay = this.clickCalendarDay.bind(this)
    }
    onPanelChange(value, type, firstDay) {
        let selectYear = formatDate(new Date(), "yyyy");
        if(typeof value == 'object'){
            selectYear = value.fields[1];
        }
        this.setState({
            type,
            selectYear
        });
        const { eid, hpid, subCompanyId } = this.props;
        var selectdate = "";
        if (typeof value === 'object') {
            var year = value.getYear();
            var month = value.getMonth() + 1 < 10 ? '0' + (value.getMonth() + 1) : value.getMonth() + 1;
            let currentMonth = year + '-' + month;
            selectdate = year + '-' + month + '-01';
            let _month = formatDate(new Date(), "yyyy-MM");
            if (selectdate === (_month + "-01")) {
                this.setState({
                    currentDate: formatDate(new Date(), "yyyy-MM-dd"),
                    currentMonth: _month,
                });
            } else {
                this.setState({
                    currentDate: selectdate,
                    currentMonth: year + '-' + month,
                });
            }
        } else {
            selectdate = value;
            this.setState({
                currentDate: selectdate,
            });
        }
        if(firstDay && type=='year') {
            selectdate = firstDay;
        }
        WeaTools.callApi('/api/workplan/calendar/MyCalendar', 'POST', {viewType: '3', selectDate: selectdate}).then(data=> {
            $("#calendar_" + eid).find(".ant-fullcalendar-current").removeClass("ant-fullcalendar-current");
            $("#calendar_" + eid).find(".ant-fullcalendar-event").removeClass("ant-fullcalendar-event");
            $("#calendar_" + eid).find(".ant-fullcalendar-event-old").removeClass("ant-fullcalendar-event-old");
            ls.set('edata-'+eid, data);
            this.setState({
                data: data,
                refresh: false,
            });
        });
    }
    componentWillMount() {
        // 异步加载日程模块静态资源
        eventRegister.loadModule('f_workplan', ()=> {
            this.setState({weaWorkplanLoaded:true});
        }, ()=> {});
    }
    componentDidMount() {
        // $("#calendar_" + this.props.eid + " .ant-fullcalendar-cell").attr("onclick", "window_clickCalendarDay['fn"+this.props.eid+"'](this)");
        this.getWorkplanData(new Date());
    }
    componentWillReceiveProps(nextProps){
        if(!isEqual(this.props, nextProps)){
            this.getWorkplanData(new Date());
        }
    }
    shouldComponentUpdate(nextProps, nextState){
        // if(nextState.type == 'month' && this.state.type == 'year'){
        //     this.setState( {type: nextState.type},() => {$("#calendar_" + this.props.eid + " .ant-fullcalendar-cell").attr("onclick", "window_clickCalendarDay['fn"+this.props.eid+"'](this)")})
        // }else if(nextState.type == 'year' && this.state.type == 'month'){
        //     this.setState( {type: nextState.type},() => {$("#calendar_" + this.props.eid + " .ant-fullcalendar-month-panel-cell").attr("onclick", "window_clickCalendarDay['fn"+this.props.eid+"'](this)")})
        // }
        if(nextState.type == 'month' && this.state.type == 'year'){
            this.setState( {type: nextState.type})
        }else if(nextState.type == 'year' && this.state.type == 'month'){
            this.setState( {type: nextState.type})
        }
        return true;
    }
    doAdd(){
        this.setState({
            singlePageVisible: true
        });
        //return window.showModalDialog("/spa/workplan/index_mobx.html#/main/wp/myWorkPlan",null,"dialogWidth=600px;dialogHeight=100px");
    }
    onAdd(){
        this.setState({
            createVisible: true,
            createType: 'create'
        });
    }
    onClose(){
        this.onPanelChange(this.state.currentDate, this.state.type, this.state.firstDay);
        this.setState({
            createVisible: false,
            activeKey: '1',
        });
        this.getWorkplanData(this.state.currentDate, this.state.type);
    }
    onClickData(id){
        this.setState({
            createVisible: true,
            createType: 'preview',
            workPlanId: id,
        });
    }

    getWorkplanData(currentDate, type) {
        let viewType = '1';
        if(type && type == 'year') {
            viewType = '3';
        }
        WeaTools.callApi('/api/workplan/calendar/MyCalendar', 'POST', {viewType: viewType, isCalendar: 0, ismobile: 1, selectDate: formatDate(new Date(currentDate), "yyyy-MM-dd")}).then(data=> {
            this.setState({
                workplanData: data,
            });
        });
    }

    render() {
        const { eid, layoutid, isShowLunarDatas='0' } = this.props;
        let className = "";
        if(isShowLunarDatas == '1') {
            className = "calendar_Lunar";
        }
        const { weaWorkplanLoaded, type, createVisible, createType, currentDate, workPlanId, activeKey, data, workplanData, singlePageVisible } = this.state;
        let createConditionParams = ['','',currentDate,formatDate(new Date(), "hh:mm"),currentDate,'23:59','0'];
        return <div id={ `calendar_${eid}`} className={className}>
            <Calendar onSelect={this.clickCalendarDay} fullscreen={false} onPanelChange={this.onPanelChange.bind(this)} monthCellRender={this.monthCellRender(eid)} value={new Date(currentDate)} dateCellRender={this.dateCellRender.bind(this,eid,this.props.data)}/>
            <CalendarData firstDay={this.state.firstDay} workplanData={workplanData} data={data} type={type} currentDate={currentDate} handleClick={this.onClickData}/>
            <div className="portal-element-calender-add" style={{borderTop: 'none'}}>
                <Icon type="plus-circle-o" title={getLabel(611, '添加')} onClick={this.onAdd} />
            </div>
            <div className="portal-element-calender-add">
                <div className="portal-element-calender-add-btn" onMouseOver={(e) => {
                    $(e.currentTarget).find("img").attr("src","/spa/portal/images/icon_cal_mouseon.png");
                }} onMouseLeave={(e) => {
                    $(e.currentTarget).find("img").attr("src","/spa/portal/images/icon_cal_mouseout.png");
                }} onClick={this.doAdd}><img className="portal-element-calender-add-btn-img" src="/spa/portal/images/icon_cal_mouseout.png" alt=''/><span style={{fontSize: '14px'}}>{getLabel(388020,"安排日程")}</span></div>
                <div className="portal-element-calender-add-data" onClick={showHdpanel}><span>{getLabel(388021,"人员动态")}</span></div>
            </div>
            {/*<div className="portal-element-calender-add-bysentence" style={{ overflow: 'hidden', textAlign: 'left', border: '1px #e5e5e5 solid', background: '#fcfcfc', padding: '6px 0', display: 'none'}}>*/}
            {/*<WeaInput value={addBySentenceValue} type="text" placeholder={getLabel(388022,"快速创建日程")} onBlur={(value) => {this.addTaskBySentence(value)}} id="taskname" style={{ height: '25px', outline: 'none', lineHeight: '20px', background: '#fff', width: '70%', fontSize: '12px', color: '#6e6e6e', marginLeft: '15%'}}/>*/}
            {/*</div>*/}
            {weaWorkplanLoaded && window.weaWorkplan && window.weaWorkplan.com ? <window.weaWorkplan.com.WorkPlanCreate
                isCustom={parseInt(layoutid) > 5}
                type={createType}//新建为'create',查看为'preview',编辑edit,共享share
                visible={createVisible}//显隐受控
                doClose={this.onClose}//关闭回调
                onlyClose={() => this.setState({createVisible: false, activeKey: '1'})}//关闭回调
                workPlanId = {workPlanId} //日程id，查看日程时用到
                createConditionParams = {createConditionParams}//创建的默认值日期和时间,没有传[]
                activeKey = {activeKey} //查看页面显示的面板1是基本信息，7是相关交流
                changeTab = {(value) => this.setState({activeKey: value})}//查看页面切换面板的回调
                selectUser = {''}//新建日程的创建人id
            /> : ''}
            {weaWorkplanLoaded && window.weaWorkplan && window.weaWorkplan.com &&<window.weaWorkplan.com.MyWorkPlan
                visible={this.state.singlePageVisible}
                isDialog={true}
                height={720}
                callback={()=>{this.setState({singlePageVisible: false},()=>{this.onPanelChange(this.state.currentDate)})}}
                location={{}}/>}
        </div>
    }
    dateCellRender(eid, data, value){
        const { isShowLunarDatas='0' } = this.props;
        const { currentDate } = this.state;
        let portalNoCurrentMonth = "";
        if(formatDate(new Date(value.time), 'yyyy-MM') != formatDate(new Date(currentDate), 'yyyy-MM')){
            portalNoCurrentMonth = "portal-no-current-month";
        }
        let dataStr1 = formatDate(new Date(value.time), 'yyyy-M-d');
        let dateStr = formatDate(new Date(value.time), 'yyyy-MM-dd');
        let lunarStr = getLunarDatas().toLunar(formatDate(new Date(value.time), 'yyyy'), formatDate(new Date(value.time), 'M'), formatDate(new Date(value.time), 'd'));
        // let dataStr2 = formatDate(new Date(lunarStr[0] + '-' + lunarStr[1] + '-' +lunarStr[2]), 'MM') + formatDate(new Date(lunarStr[0] + '-' + lunarStr[1] + '-' +lunarStr[2]), 'dd');
        let dataStr2 = getLunarDatas().toLunarMonth(lunarStr.lunarMonth) + getLunarDatas().toLunarNumber(lunarStr.lunarDay);
        let dataStr3 = formatDate(new Date(value.time), 'MM') + formatDate(new Date(value.time), 'dd');
        let lunarDatas = lunarStr.lunarDay;
        if(lunarDatas == '初一'){
            lunarDatas = lunarStr.lunarMonth + '月';
        }
        let jq = getLunarDatas().getjq(formatDate(new Date(value.time), 'yyyy'),formatDate(new Date(value.time), 'MM'),formatDate(new Date(value.time), 'dd'));
        if(jq != '') {
            lunarDatas = jq;
        }

        if(getLunarDatas().holidayName(formatDate(new Date(value.time), 'yyyy'), dataStr2, dataStr3)  !==undefined ) {
            lunarDatas = getLunarDatas().holidayName(formatDate(new Date(value.time), 'yyyy'), dataStr2, dataStr3);
        }

        let events = this.state.data.events;
        let timer = setTimeout(()=>{
            events.map(arr => {
                let startDate = formatDate(new Date(arr[2]), 'yyyy-MM-dd');
                let endDate = formatDate(new Date(arr[3]), 'yyyy-MM-dd');
                if(dateStr >= startDate && dateStr <= endDate){
                    $("#calendar_" + eid + " .ant-fullcalendar-cell[title='" + dataStr1 + "'] .ant-fullcalendar-value").addClass("ant-fullcalendar-event");
                }
            });
            if(dateStr === currentDate){
                $("#calendar_" + eid + " .ant-fullcalendar-cell[title='" + dataStr1 + "'] .ant-fullcalendar-value").addClass("ant-fullcalendar-current");
            }
            clearTimeout(timer);
        },100);
        if(isShowLunarDatas != '0'){
            return (
                <div className={`portal-element-calender-lunar ${portalNoCurrentMonth}`}>
                    {lunarDatas}
                </div>
            );
        }
    }

    monthCellRender(eid){
        $("#calendar_" + eid).find(".ant-fullcalendar-month-panel-selected-cell").removeClass("ant-fullcalendar-month-panel-current-cell");
        $("#calendar_" + eid + " .ant-fullcalendar-month-panel-selected-cell .ant-fullcalendar-month .ant-fullcalendar-value").css({border: '#2db7f5 solid 1px'});
    }

    clickCalendarDay(obj){
        const { eid } = this.props;
        const { currentDate, currentMonth, type } = this.state;
        if(type == 'year'){
            this.clickCalendarMonth(obj);
            return;
        }
        $("#calendar_"+eid).find(".ant-fullcalendar-current").removeClass("ant-fullcalendar-current");
        var title = formatDate(new Date(obj.time), "yyyy-MM-dd");
        var ndate = "";
        var currentMonthStr =  "";
        if(title) {
            var titlearr =  title.split("-");
            ndate = titlearr[0];
            currentMonthStr = titlearr[0];
            ndate = ndate + "-" + titlearr[1];
            currentMonthStr = currentMonthStr + "-"+titlearr[1];
            ndate = ndate + "-" + titlearr[2];
        }
        if(ndate){
            this.setState({
                currentDate: ndate,
            });
        }
        this.getWorkplanData(ndate);
        //判断点击的是否为当前显示月份，否的话刷新新月份的日历日程，并默认选中所点击的日期
        if(currentMonthStr !== currentMonth){
            this.setState({
                currentMonth: currentMonthStr,
            });
            this.onPanelChange(ndate,"month");
        }
    }

    clickCalendarMonth(obj){
        const { eid } = this.props;
        const { selectYear } = this.state;
        let dateStr = formatDate(new Date(), 'MM');
        var date = formatDate(new Date(obj.time), "MM");
        const { currentDate, currentMonth } = this.state;
        let monthMatch = {
            "01" : getLabel("25825", "1月"),
            "02" : getLabel("25826", "2月"),
            "03" : getLabel("25827", "3月"),
            "04" : getLabel("25828", "4月"),
            "05" : getLabel("25829", "5月"),
            "06" : getLabel("25830", "6月"),
            "07" : getLabel("25831", "7月"),
            "08" : getLabel("25832", "8月"),
            "09" : getLabel("25833", "9月"),
            "10" : getLabel("25834", "10月"),
            "11" : getLabel("25835", "11月"),
            "12" : getLabel("25836", "12月")
        };
        let x = Math.ceil(dateStr/3);
        let y = dateStr - (x-1) * 3;
        let a = Math.ceil(date/3);
        let b = date - (a-1) * 3;
        if(monthMatch[dateStr].trim() !== parseInt(date)+'月'){
            // $("#calendar_" + eid + " .ant-fullcalendar-month-panel-cell[title='" + monthMatch[dateStr].trim() + "'] >div").addClass("ant-fullcalendar-month-panel-current-cell");
            $($($("#calendar_" + eid + " .ant-fullcalendar").find('tr')[x-1].children[y-1]).find('div')[0]).addClass("ant-fullcalendar-month-panel-current-cell");
            $("#calendar_" + eid + " .ant-fullcalendar-month-panel-selected-cell").removeClass("ant-fullcalendar-month-panel-selected-cell");
            $("#calendar_" + eid + " .ant-fullcalendar-month-panel-cell .ant-fullcalendar-value").css('border', 'none');
            $($($("#calendar_" + eid + " .ant-fullcalendar").find('tr')[a-1].children[b-1]).find('div')[0]).find(".ant-fullcalendar-value").css('border', '#2db7f5 solid 1px');
        }else {
            $("#calendar_" + eid + " .ant-fullcalendar-month-panel-cell .ant-fullcalendar-value").css('border', 'none');
            $("#calendar_" + eid + " .ant-fullcalendar-month-panel-selected-cell").removeClass("ant-fullcalendar-month-panel-selected-cell");
            // $("#calendar_" + eid).find(".ant-fullcalendar-month-panel-selected-cell").removeClass("ant-fullcalendar-month-panel-current-cell");
            $($($("#calendar_" + eid + " .ant-fullcalendar").find('tr')[x-1].children[y-1]).find('div')[0]).removeClass("ant-fullcalendar-month-panel-current-cell");
            $($($("#calendar_" + eid + " .ant-fullcalendar").find('tr')[x-1].children[y-1]).find('div')[0]).parent().addClass("ant-fullcalendar-month-panel-selected-cell");
            // $("#calendar_" + eid + " .ant-fullcalendar-month-panel-cell[title='" + monthMatch[dateStr].trim() + "'] >div").removeClass("ant-fullcalendar-month-panel-current-cell");
            $("#calendar_" + eid + " .ant-fullcalendar-month-panel-selected-cell .ant-fullcalendar-month .ant-fullcalendar-value").css('border','#2db7f5 solid 1px');
        }
        let selectMonth = '';
        for (let key in monthMatch) {
            if(monthMatch[key] == parseInt(date)+'月') {
                selectMonth =key;
                break;
            }
        }
        let firstDay =formatDate(new Date(selectYear,selectMonth-1,1),"yyyy-MM-dd");//这个月的第一天
        WeaTools.callApi('/api/workplan/calendar/MyCalendar', 'POST', {viewType: '3', selectDate: firstDay}).then(data=> {
            ls.set('edata-'+eid, data);
            this.setState({
                data: data,
                refresh: false,
                firstDay: firstDay,
            });
        });
    }
}
class MyErrorHandler extends React.Component {
    render() {
        const hasErrorMsg = this.props.error && this.props.error !== "";
        return (
            <WeaErrorPage msg={hasErrorMsg?this.props.error:getLabel(385218,"对不起，该页面异常，请联系管理员！")} />
        );
    }
}
CalendarTemplate = WeaTools.tryCatch(React, MyErrorHandler, { error: "" })(CalendarTemplate);
export default CalendarTemplate;

class CalendarData extends React.Component {
    tc(d) {
        function zc(c, i) {
            var d = "666666888888aaaaaabbbbbbdddddda32929cc3333d96666e69999f0c2c2b1365fdd4477e67399eea2bbf5c7d67a367a994499b373b3cca2cce1c7e15229a36633cc8c66d9b399e6d1c2f029527a336699668cb399b3ccc2d1e12952a33366cc668cd999b3e6c2d1f01b887a22aa9959bfb391d5ccbde6e128754e32926265ad8999c9b1c2dfd00d78131096184cb05288cb8cb8e0ba52880066aa008cbf40b3d580d1e6b388880eaaaa11bfbf4dd5d588e6e6b8ab8b00d6ae00e0c240ebd780f3e7b3be6d00ee8800f2a640f7c480fadcb3b1440edd5511e6804deeaa88f5ccb8865a5aa87070be9494d4b8b8e5d4d47057708c6d8ca992a9c6b6c6ddd3dd4e5d6c6274878997a5b1bac3d0d6db5a69867083a894a2beb8c1d4d4dae54a716c5c8d8785aaa5aec6c3cedddb6e6e41898951a7a77dc4c4a8dcdccb8d6f47b08b59c4a883d8c5ace7dcce";
            return "#" + d.substring(c * 30 + i * 6, c * 30 + (i + 1) * 6);
        }
        var c = d != null && d != undefined ? d : option.theme;
        return [zc(c, 0), zc(c, 1), zc(c, 2), zc(c, 3)];
    }

    render(){
        const { data, currentDate, handleClick,eid, type = 'month', workplanData,firstDay} = this.props;
        const { mobileEvents, start } = workplanData;
        const { events } = data;
        let index = 0;
        let color = '#a32929';


        if(type == 'month') {
            let datas = [];
            let hasEvent = false;
            if(mobileEvents && mobileEvents.length){
                let html = mobileEvents.map(arr => {
                    if(arr[7]) color = arr[7];
                    if(arr.color) color = arr.color;
                    // let sdate = new Date(arr[2]);
                    // let edate = new Date(arr[3]);
                    let startStr = formatDate(new Date(arr.beginDate),"yyyy-MM-dd");
                    let endStr = formatDate(new Date(arr.endDate),"yyyy-MM-dd");
                    let id = arr.id;
                    let name = arr.planName;
                    let stime = arr.beginTime;
                    let ss = "";
                    if(!isNaN(parseInt(stime))) {
                        ss = parseInt(stime) >= 12 ? 'PM' : 'AM';
                    }
                    if (currentDate >= startStr && currentDate <= endStr) {
                        hasEvent = true;
                        index += 1;
                        return <div className='hand dataEvent' style={{height:'34px', border: '0px solid #f3f2f2'}} onClick={handleClick.bind(this,id)} title={name}>
                            <div className='dataEvent1' style={{background: color}}></div>
                            <div className='dataEvent2'>
                                <div className='dataEvent2_1'>
                                    {stime}&nbsp;&nbsp;{ss}
                                </div>
                            </div>
                            <div class='dataEvent3'>{name}</div>
                        </div>
                    }
                });
                let height = index * 34;
                if (index < 3) {
                    return <div id='planDataEvent' className='planDataEvent portal-element-calender-event'>
                        <div id='planDataEventchd' style={{minHeight:'102px'}}>
                            {hasEvent ? html : <div className="portal-element-calender-noevent">{getLabel(388023,"无日程数据")}</div>}
                        </div>
                    </div>
                }
                return <WeaNewScroll scrollId="Element_MyCalendar_Scroll" height={103}>
                    <div id='planDataEvent' className='planDataEvent portal-element-calender-event'>
                        <div id='planDataEventchd' style={{minHeight:'102px'}}>
                            {hasEvent ? html : <div className="portal-element-calender-noevent">{getLabel(388023,"无日程数据")}</div>}
                        </div>
                    </div>
                </WeaNewScroll>
            }else {
                return <div id='planDataEvent' className='planDataEvent portal-element-calender-event'>
                    <div id='planDataEventchd' style={{minHeight:'102px'}}>
                        {hasEvent ? html : <div className="portal-element-calender-noevent">{getLabel(388023,"无日程数据")}</div>}
                    </div>
                </div>
            }
        }else{
            let hasEvent = false;
            if(events && events.length){
                let html = events.map(arr => {
                    let sdate = new Date(arr[2]);
                    let edate = new Date(arr[3]);
                    const smonth = formatDate(sdate, 'MM');
                    const emonth = formatDate(edate, 'MM');
                    const firstmonth = formatDate(new Date(firstDay), 'MM');
                    if(parseInt(smonth) == parseInt(firstmonth) || parseInt(emonth)==parseInt(firstmonth) ||
                        (parseInt(smonth) <= parseInt(firstmonth) && parseInt(firstmonth)<=parseInt(emonth))){
                        let id = arr[0];
                        let name = arr[1];
                        let mdata = formatDate(sdate, 'MM-dd  hh:mm')
                        let ss = parseInt(formatDate(sdate, 'hh')) >= 12 ? 'PM' : 'AM';
                        hasEvent = true;
                        index += 1;
                        return <div className='hand dataEvent' style={{height: '34px'}}
                                    onClick={handleClick.bind(this, id)} title={name}>
                            <div className='dataEvent1' style={{background: '#a32929'}}></div>
                            <div className='dataEvent2' style={{width: '111px'}}>
                                <div className='dataEvent2_1'>
                                    {mdata}&nbsp;&nbsp;{ss}
                                </div>
                            </div>
                            <div class='dataEvent3'>{name}</div>
                        </div>
                    }
                });
                let height = index * 34;
                if (index < 3) {
                    return <div id='planDataEvent' className='planDataEvent portal-element-calender-event'>
                        <div id='planDataEventchd' style={{minHeight:'102px'}}>
                            {events.length > 0 ? html : <div className="portal-element-calender-noevent">{getLabel(388023,"无日程数据")}</div>}
                        </div>
                    </div>
                }
                return <WeaNewScroll scrollId="Element_MyCalendar_Scroll" height={103}>
                    <div id='planDataEvent' className='planDataEvent portal-element-calender-event'>
                        <div id='planDataEventchd' style={{minHeight:'102px'}}>
                            {events.length > 0 ? html : <div className="portal-element-calender-noevent">{getLabel(388023,"无日程数据")}</div>}
                        </div>
                    </div>
                </WeaNewScroll>
            }
        }
        return <div/>
    }
}

function showHdpanel(){
    let calendarDialog = null;
    if(window.top.Dialog){
        calendarDialog = new window.top.Dialog();
    } else {
        calendarDialog = new Dialog();
    }
    calendarDialog.URL ="/page/element/hdpanel/newView.jsp?isDialog=1&hdpanelTypeValue=downLvl&ebaseid=hdpanel&eid=49296";
    calendarDialog.Width = 700;
    calendarDialog.Height = 400;
    calendarDialog.checkDataChange = false;
    calendarDialog.Title=getLabel(388024,"人员看板");
    calendarDialog.show();

}
